package old.gui;

import com.jme3.scene.shape.Quad;

/*
 * The basic building block of a GUI.  
 * Components are currently restrcited to Quads
 * Components may overlap each other
 * Components may implement various interface classes.
 * Components may be rendered.
 */
public abstract class GUIComponent extends Quad {
	
	//Component size information, in pixels
	private int componentWidth;
	private int componentHeight;
	
	public GUIComponent(int width, int height)
	{
		resize(width, height);
	}
	
	//Change displayed size of component (pixels)
	public void resize(int componentWidth, int componentHeight)
	{
		this.componentWidth = componentWidth;
		this.componentHeight = componentHeight;
		updateGeometry((float)componentWidth, (float)componentHeight);
	}	
	
	public int getComponentWidth()
	{return this.componentWidth;}
	
	public int getComponentHeight()
	{return this.componentHeight;}	
}

/*public int getScreenWidth()
{return this.screenWidth;}

public int getScreenHeight()
{return this.screenHeight;}*/

//Only called internally, when default resolution is changed
//private void setAspectRatio(float newAspectRatio)
//{this.screenRatio = newAspectRatio;}

//public float getAspectRatio()
//{return this.screenRatio;}

//Change default resolution of component (pixels)
/*public void setResolution(int resWidth, int resHeight)
{
	this.screenWidth = resWidth;
	this.screenHeight = resHeight;
	setAspectRatio((float) resWidth/resHeight);
}*/



//private void initialize(int width, int height)
//{
//	setQueueBucket(Bucket.Gui);
//	setCullHint(CullHint.Never);
//	
//	resize(width, height);				
//}
